<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>AUI快速完成布局</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/footer.css" />
    <link rel="stylesheet" type="text/css" href="../font/iconfont.css" />
    <script src="../font/iconfont.js"></script>



</head>

<body>
    <!-- <header class="aui-bar aui-bar-nav aui-bar-light" id="header">
         <a class="aui-pull-left aui-btn" tapmode onclick="api.closeWin();">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title">个人中心页面</div>

    </header> -->
    <footer class="aui-bar aui-bar-tab" id="footer">
    <div class="aui-bar-tab-item aui-active footer-tab" tapmode data-name="main" data-url="main.html">
   <svg class="icon svg-icon" aria-hidden="true">
      <use xlink:href="#iconsk-shouyeweixuanzhong">
      </svg>
      <!-- <svg class="icon svg-icon" aria-hidden="true">
        <use xlink:href="#iconsk-shouyexuanzhong">
      </svg> -->
        <div class="aui-bar-tab-label" style="color:black;">首页</div>
    </div>
    <div class="aui-bar-tab-item footer-tab" tapmode  data-name="task_center" data-url="task_center.html">
      <svg class="icon svg-icon" aria-hidden="true">
        <use xlink:href="#iconsk-mianfeishiyong">
      </svg>
    <!-- <svg class="icon svg-icon" aria-hidden="true">
    <use xlink:href="#iconsk-mianfeishiyongxuanzhong">
    </svg> -->
        <div class="aui-bar-tab-label">全部</div>
    </div>
    <div class="aui-bar-tab-item footer-tab" tapmode  data-name="member_friend" data-url="member_friend.html">

      <svg class="icon svg-icon" aria-hidden="true">
      <use xlink:href="#iconsk-fenxiangyoujiang-copy">
      </svg>
      <!-- <svg class="icon svg-icon" aria-hidden="true">
  <use xlink:href="#iconsk-fenxiangyoujiang">
  </svg> -->
        <div class="aui-bar-tab-label">邀请</div>
    </div>
    <div class="aui-bar-tab-item footer-tab" tapmode  data-name="task_ing" data-url="task_ing.html">

        <svg class="icon svg-icon" aria-hidden="true">
          <use xlink:href="#iconsk-zhibolishi-copy">
        </svg>
        <!-- <svg class="icon svg-icon" aria-hidden="true">
  <use xlink:href="#iconsk-zhibolishi">
  </svg> -->
        <div class="aui-bar-tab-label">试用进展</div>
    </div>
    <div class="aui-bar-tab-item footer-tab" tapmode data-name="person_center" data-url="person_center.html">
      <!-- <svg class="icon svg-icon" aria-hidden="true">
        <use xlink:href="#iconsk-zhanghaoweixuanzhong">
      </svg> -->
     <svg class="icon svg-icon" aria-hidden="true">
      <use xlink:href="#iconsk-zhanghaoxuanzhong">
      </svg>
        <div class="aui-bar-tab-label" style="color:#ff4285;">我的</div>
    </div>
    </footer>
    <!-- <footer class="aui-bar aui-bar-tab" id="footer">
        <div class="aui-bar-tab-item  footer-tab" tapmode data-name="main" data-url="main.html">
            <i class="aui-iconfont aui-icon-home"></i>
            <div class="aui-bar-tab-label">首页</div>
        </div>
        <div class="aui-bar-tab-item footer-tab" tapmode data-name="task_center" data-url="task_center.html">
            <i class="aui-iconfont aui-icon-star"></i>
            <div class="aui-bar-tab-label">任务中心</div>
        </div>
        <div class="aui-bar-tab-item footer-tab" tapmode data-name="member_friend" data-url="member_friend.html">

            <i class="aui-iconfont aui-icon-cart"></i>
            <div class="aui-bar-tab-label">邀请有奖</div>
        </div>
        <div class="aui-bar-tab-item footer-tab" tapmode data-name="task_ing" data-url="task_ing.html">
          <i class="aui-iconfont aui-icon-paper"></i>
            <div class="aui-bar-tab-label">任务进展</div>
        </div>
        <div class="aui-bar-tab-item footer-tab aui-active" tapmode data-name="login" data-url="login.html">
            <div class="aui-dot"></div>
            <i class="aui-iconfont aui-icon-my"></i>
            <div class="aui-bar-tab-label">我的</div>
        </div>
    </footer> -->
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="./conf/config.js"></script>
<script type="text/javascript" src="./js/common.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
    apiready = function() {
        //window.location.reload();
        initEventListenner(); //退出键添加提示框
        // var header = $api.byId('header');
        // var headerH = $api.offset(header).h;
        var footer = $api.byId('footer');
        var footerH = $api.offset(footer).h;
        api.openFrame({
            name: 'person_center_frame',
            url: './person_center_frame.html',
            rect: {
                x: 0,
                y: 0,
                w: 'auto',
                h: api.winHeight - footerH ,
            },
            pageParam: {
                wareId: api.pageParam.wareId
            },
            bounces: true
        });

        $("#footer .footer-tab").each(function() {
            $(this).click(function() {
                var name = $(this).attr("data-name");
                var url = $(this).attr("data-url");
                //判断是否登录
                var is_login = $api.getStorage("userInfo");
                if (is_login && name == "login") {
                    api.openWin({
                        name: "person_center",
                        url: "./person_center.html",
                        opaque: true,
                        vScrollBarEnabled: false

                    });

                } else {
                    api.openWin({
                        name: name,
                        url: url,
                        opaque: true,
                        vScrollBarEnabled: false

                    });

                }

            });
        });


    };

    function initEventListenner() {

        api.addEventListener({
            name: 'keyback'
        }, function(ret, err) {
            api.confirm({
                title: '提示',
                msg: '是否退出应用',
                buttons: ['确定', '取消']
            }, function(ret, err) {
                if (ret.buttonIndex == 1) {
                    api.closeWidget({
                        silent: true
                    });
                }
            });
        });
    };
</script>

</html>
